package com.jeesite.modules.isys.common.aop.check;

import com.jeesite.modules.isys.common.entity.MyPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class CheckMyPage implements CheckEntity<MyPage>{

    @Autowired
    private CheckList checkList;
    @Override
    public MyPage check(MyPage page) throws Exception {
        if (page == null){
            return page;
        }

        Object list = page.getList();
        list  = checkList.check((List) list);

        page.setList(list);
        return page;
    }

    @Override
    public MyPage checkArg(MyPage page) throws Exception {
        if (page == null){
            return page;
        }

        Object list = page.getList();
        list  = checkList.checkArg((List) list);

        page.setList(list);
        return page;
    }
}
